Class NullToDefaultConverter<T>

Assembly: redb.Core.dll

Converter that returns default(T) when JSON contains null for a non-nullable value type.

public class NullToDefaultConverter<T> : JsonConverter<T> where T : struct

Inheritance

ObjectJsonConverterJsonConverter<T>NullToDefaultConverter<T>

Methods

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads and converts the JSON to type T.

public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Write(Utf8JsonWriter, T, JsonSerializerOptions)

Writes a specified value as JSON.

public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)